//
//  LOLFriendsViewController.m
//  LOLNews
//
//  Created by MXL on 16/10/28.
//  Copyright © 2016年 KK. All rights reserved.
//

#import "LOLFriendsViewController.h"
#import "LOLTopViewXib.h"
#import "LOLRollViewController.h"

@interface LOLFriendsViewController ()

@end

@implementation LOLFriendsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - 界面
- (void)setupUI{
    // 隐藏导航条
    self.navigationController.navigationBar.hidden = YES;
    self.view.backgroundColor = [UIColor blueColor];
    
    // 这里是按钮的view
    LOLTopViewXib *topView = [LOLTopViewXib topViewXib];
    
    [self.view addSubview:topView];
    
    topView.backgroundColor = [UIColor redColor];
    
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.view);
        make.top.equalTo(self.view).offset(20);
        make.height.mas_equalTo(44);
    }];
    // 这里是滚动的控制器
    LOLRollViewController *vc = [[LOLRollViewController alloc]init];
    
    [self addChildViewController:vc];
    
    [self.view addSubview:vc.view];
    
    [vc didMoveToParentViewController:self];
    
    // 布局
    [vc.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(topView.mas_bottom);
        make.bottom.left.right.equalTo(self.view);
    }];
}

@end
